//
//  TrillData.swift
//  ios_swift_demo1
//
//  Created by liutao on 2020/7/17.
//  Copyright © 2020 lt. All rights reserved.
//

import Foundation


struct Resource: Codable {
    var code: Int?
    var minId: Int?
    var msg: String?
    var data: [TrillEntity]

    enum CodingKeys: String, CodingKey {
        case code = "code"
        case minId = "min_id"
        case msg = "msg"
        case data = "data"
    }
}


struct TrillEntity : Codable {

    let activityPlan : String?
    let activityType : String?
    let activityid : String?
    let couponendtime : String?
    let couponmoney : String?
    let couponnum : String?
    let couponreceive : String?
    let couponstarttime : String?
    let couponsurplus : String?
    let couponurl : String?
    let discount : String?
    let downType : String?
    let dyTrillId : String?
    let dyVideoLikeCount : String?
    let dyVideoShareCount : String?
    let dyVideoTitle : String?
    let dyVideoUrl : String?
    let dynamicImage : String?
    let firstFrame : String?
    let fqcat : String?
    let generalIndex : String?
    let gradeAvg : String?
    let guideArticle : String?
    let isForeshow : String?
    let itemdesc : String?
    let itemendprice : String?
    let itemid : String?
    let itempic : String?
    let itempicCopy : String?
    let itemprice : String?
    let itemsale : String?
    let itemsale2 : String?
    let itemshorttitle : String?
    let itemtitle : String?
    let productId : String?
    let rateTotal : String?
    let reportStatus : String?
    let sellerId : String?
    let sellerName : String?
    let shopid : String?
    let shopname : String?
    let shoptype : String?
    let stock : String?
    let tkmoney : String?
    let tkrates : String?
    let todaysale : String?
    let userid : String?
    let videoid : String?


    enum CodingKeys: String, CodingKey {
        case activityPlan = "activity_plan"
        case activityType = "activity_type"
        case activityid = "activityid"
        case couponendtime = "couponendtime"
        case couponmoney = "couponmoney"
        case couponnum = "couponnum"
        case couponreceive = "couponreceive"
        case couponstarttime = "couponstarttime"
        case couponsurplus = "couponsurplus"
        case couponurl = "couponurl"
        case discount = "discount"
        case downType = "down_type"
        case dyTrillId = "dy_trill_id"
        case dyVideoLikeCount = "dy_video_like_count"
        case dyVideoShareCount = "dy_video_share_count"
        case dyVideoTitle = "dy_video_title"
        case dyVideoUrl = "dy_video_url"
        case dynamicImage = "dynamic_image"
        case firstFrame = "first_frame"
        case fqcat = "fqcat"
        case generalIndex = "general_index"
        case gradeAvg = "grade_avg"
        case guideArticle = "guide_article"
        case isForeshow = "is_foreshow"
        case itemdesc = "itemdesc"
        case itemendprice = "itemendprice"
        case itemid = "itemid"
        case itempic = "itempic"
        case itempicCopy = "itempic_copy"
        case itemprice = "itemprice"
        case itemsale = "itemsale"
        case itemsale2 = "itemsale2"
        case itemshorttitle = "itemshorttitle"
        case itemtitle = "itemtitle"
        case productId = "product_id"
        case rateTotal = "rate_total"
        case reportStatus = "report_status"
        case sellerId = "seller_id"
        case sellerName = "seller_name"
        case shopid = "shopid"
        case shopname = "shopname"
        case shoptype = "shoptype"
        case stock = "stock"
        case tkmoney = "tkmoney"
        case tkrates = "tkrates"
        case todaysale = "todaysale"
        case userid = "userid"
        case videoid = "videoid"
    }
    init(from decoder: Decoder) throws {
        let values = try decoder.container(keyedBy: CodingKeys.self)
        activityPlan = try values.decodeIfPresent(String.self, forKey: .activityPlan)
        activityType = try values.decodeIfPresent(String.self, forKey: .activityType)
        activityid = try values.decodeIfPresent(String.self, forKey: .activityid)
        couponendtime = try values.decodeIfPresent(String.self, forKey: .couponendtime)
        couponmoney = try values.decodeIfPresent(String.self, forKey: .couponmoney)
        couponnum = try values.decodeIfPresent(String.self, forKey: .couponnum)
        couponreceive = try values.decodeIfPresent(String.self, forKey: .couponreceive)
        couponstarttime = try values.decodeIfPresent(String.self, forKey: .couponstarttime)
        couponsurplus = try values.decodeIfPresent(String.self, forKey: .couponsurplus)
        couponurl = try values.decodeIfPresent(String.self, forKey: .couponurl)
        discount = try values.decodeIfPresent(String.self, forKey: .discount)
        downType = try values.decodeIfPresent(String.self, forKey: .downType)
        dyTrillId = try values.decodeIfPresent(String.self, forKey: .dyTrillId)
        dyVideoLikeCount = try values.decodeIfPresent(String.self, forKey: .dyVideoLikeCount)
        dyVideoShareCount = try values.decodeIfPresent(String.self, forKey: .dyVideoShareCount)
        dyVideoTitle = try values.decodeIfPresent(String.self, forKey: .dyVideoTitle)
        dyVideoUrl = try values.decodeIfPresent(String.self, forKey: .dyVideoUrl)
        dynamicImage = try values.decodeIfPresent(String.self, forKey: .dynamicImage)
        firstFrame = try values.decodeIfPresent(String.self, forKey: .firstFrame)
        fqcat = try values.decodeIfPresent(String.self, forKey: .fqcat)
        generalIndex = try values.decodeIfPresent(String.self, forKey: .generalIndex)
        gradeAvg = try values.decodeIfPresent(String.self, forKey: .gradeAvg)
        guideArticle = try values.decodeIfPresent(String.self, forKey: .guideArticle)
        isForeshow = try values.decodeIfPresent(String.self, forKey: .isForeshow)
        itemdesc = try values.decodeIfPresent(String.self, forKey: .itemdesc)
        itemendprice = try values.decodeIfPresent(String.self, forKey: .itemendprice)
        itemid = try values.decodeIfPresent(String.self, forKey: .itemid)
        itempic = try values.decodeIfPresent(String.self, forKey: .itempic)
        itempicCopy = try values.decodeIfPresent(String.self, forKey: .itempicCopy)
        itemprice = try values.decodeIfPresent(String.self, forKey: .itemprice)
        itemsale = try values.decodeIfPresent(String.self, forKey: .itemsale)
        itemsale2 = try values.decodeIfPresent(String.self, forKey: .itemsale2)
        itemshorttitle = try values.decodeIfPresent(String.self, forKey: .itemshorttitle)
        itemtitle = try values.decodeIfPresent(String.self, forKey: .itemtitle)
        productId = try values.decodeIfPresent(String.self, forKey: .productId)
        rateTotal = try values.decodeIfPresent(String.self, forKey: .rateTotal)
        reportStatus = try values.decodeIfPresent(String.self, forKey: .reportStatus)
        sellerId = try values.decodeIfPresent(String.self, forKey: .sellerId)
        sellerName = try values.decodeIfPresent(String.self, forKey: .sellerName)
        shopid = try values.decodeIfPresent(String.self, forKey: .shopid)
        shopname = try values.decodeIfPresent(String.self, forKey: .shopname)
        shoptype = try values.decodeIfPresent(String.self, forKey: .shoptype)
        stock = try values.decodeIfPresent(String.self, forKey: .stock)
        tkmoney = try values.decodeIfPresent(String.self, forKey: .tkmoney)
        tkrates = try values.decodeIfPresent(String.self, forKey: .tkrates)
        todaysale = try values.decodeIfPresent(String.self, forKey: .todaysale)
        userid = try values.decodeIfPresent(String.self, forKey: .userid)
        videoid = try values.decodeIfPresent(String.self, forKey: .videoid)
    }
}
